package models

type OaMenu struct {
	Id       int    `xorm:"not null pk autoincr comment('自增主键') INT(11)" json:"id"`
	Title    string `json:"title"`
	ParentId int    `xorm:"not null comment('') index INT(11)" json:"parent_id"`
	Cate     int    `xorm:"not null comment('') index INT(11)" json:"cate"`
}

func (m *OaMenu) GetMenuList() (list []*OaMenu, err error) {
	err = engine.Table("oa_menu").Where("cate in (?,?) ", "1", "2").
		Find(&list)
	return list, err
}

func (m *OaMenu) GetUserRoleList() (list []*OaMenu, err error) {
	err = engine.Table("oa_menu").
		Find(&list)
	return list, err
}
